// Copyright  2004-2008 Backplane Ltd.
//
// This file is part of Ubiquity formsPlayer
//
// Ubiquity formsPlayer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
//
// Ubiquity formsPlayer is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License
// along with Ubiquity formsPlayer If not, see <http://www.gnu.org/licenses/>.
//	
//
//   Purpose: implementation of  CImpFormControlInput.
//   $Id$


#include "stdafx.h"
#include "implFormControlInput.h"
#include "commonChild.h"
#include "FormControlInputUI.h"


HRESULT CImplFormControlInput::detachCaption(void)
{
	m_pCaption = 0;
	return S_OK;
}

HRESULT CImplFormControlInput::detachAlert(void)
{
	m_pAlert = 0;
	return S_OK;
}

CImplFormControlInput::CImplFormControlInput(CXFormsElementFormControlInput* pElement)
	: CImplFormControlInputBase(pElement)
	,m_pAlert(NULL)
	,m_pCaption(NULL)

{
}

CImplFormControlInput::~CImplFormControlInput()
{
	if(m_pAlert)
		m_pAlert->m_pParent = 0;
	if(m_pCaption)
		m_pCaption->m_pParent = 0;
}


HRESULT CImplFormControlInput::onCaptionValueChange(BSTR sCaption)
{
	CComBSTR bsParam(sCaption);
	HRESULT hr = reinterpret_cast<CXFormsElementFormControlInput*>(m_pXFormsElement)->put_caption(bsParam);
	return hr;
}

HRESULT CImplFormControlInput::onAlertValueChange(BSTR sAlert)
{
	CComBSTR bsParam(sAlert);
	return reinterpret_cast<CXFormsElementFormControlInput*>(m_pXFormsElement)->put_alert(bsParam);
}

